Add tracing to data race functions #4523
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds tracing calls to the
Vclocks
data race checks.data_race
seem to amount to around 5% of the program time, although given the sheer amount of very short-lived tracing calls I think most of that 5% is spent within the tracing infrastructure. The trace file for analysis below was obtained by running the multithreaded program at the bottom withn=100
andthread_count=5
; let me know if there is a better multithreaded example I could try where data race checks are more prominent.The following table was obtained with the SQL query below in ui.perfetto.dev, on the trace file mentioned above.
This is the partitioning of calls among the various
data_race
spans being traced (even nested ones are included here, that's why the count(*) don't add up to 498874. It was obtained with the SQL query below on the same trace file as before.Rust code that was used as a benchmark to pass to Miri to collect traces